﻿using System;
using System.Collections.Generic;
using Domain.MainModule.Entities;

namespace Application.MainModule.IdentitiesManagement
{
    public interface IIdentityManagementService
    {
        /// <summary>
        /// Add a new identity.
        /// </summary>
        /// <param name="identity">Identity to be added</param>
        void AddIdentity(Identity identity);

        /// <summary>
        /// Change existing identity.
        /// </summary>
        /// <param name="identity">Existing identity to be modified.</param>
        void ChangeIdentity(Identity identity);

        /// <summary>
        /// Find a identity by its Id.
        /// </summary>
        /// <param name="identityId">IdentityId</param>
        /// <returns>A identity.</returns>
        Identity FindIdentityById(Guid identityId);

        /// <summary>
        /// Find a identity by user Id.
        /// </summary>
        /// <param name="userId">Membership UserId</param>
        /// <returns>A identity.</returns>
        List<Identity> FindIdentityByUserId(Guid userId);

        /// <summary>
        /// Remove existing identity.
        /// </summary>
        /// <param name="identity">The identity to be removed.</param>
        void RemoveIdentity(Identity identity);

        /// <summary>
        /// Find all identitytypes with name match with <paramref name="identityTypeName"/>
        /// </summary>
        /// <param name="name">A identity type name that result match.</param>
        /// <returns>A collection of identity type.</returns>
        List<IdentityType> FindIdentityTypesByName(string identityTypeName);
    }
}
